package com.zjitc.pigspring.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zjitc.pigspring.bean.po.Shop;
import com.zjitc.pigspring.bean.po.ShopVO;
import com.zjitc.pigspring.mapper.GoodsMapper;
import com.zjitc.pigspring.mapper.ShopMapper;
import com.zjitc.pigspring.service.GoodsService;
import com.zjitc.pigspring.service.ShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ShopServiceImpl extends ServiceImpl<ShopMapper, Shop> implements ShopService {

    @Autowired
    private ShopMapper shopMapper;

    @Override
    public List<ShopVO> getAll() {
        return shopMapper.getAll();
    }

    @Override
    public List<ShopVO> getAllByUser(Integer id) {
        return shopMapper.getAllByUser(id);
    }

    @Override
    public List<ShopVO> getListByUsername(ShopVO shopVO) {
        return shopMapper.selectByShop(shopVO);
    }

    @Override
    public boolean deleteByGoodId(Integer id) {
        return shopMapper.deleteByGoodId(id);
    }

    @Override
    public boolean deleteByUserId(Integer id) {
        return shopMapper.deleteByUserId(id);
    }
}
